package com.byzx.wine.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.byzx.wine.po.Syorg;
import com.byzx.wine.service.ISyorgService;


@Controller
@RequestMapping(value ="syorg")
public class SyorgAction {

	@Autowired
	private ISyorgService syorgService;
	@RequestMapping("index")
	public String login(HttpServletResponse response, HttpServletRequest request) {
		return "syorg/syorg";
	}

	@RequestMapping("/selectByPrimaryKey")
	@ResponseBody
	public Syorg  selectByPrimaryKey(Integer id){
		Syorg s =syorgService.selectByPrimaryKey(id);
		return s;
	}
	
	@RequestMapping("/selectAll")
	@ResponseBody
	public List<Syorg> selectAll(){
		List<Syorg>  list=syorgService.selectAll();
		return list;
	}
	
	@RequestMapping("/syorgdelete")
	@ResponseBody
	public  Integer deleteByPrimaryKey(Integer id){
		Integer i =syorgService.deleteByPrimaryKey(id);
		return i;
	}
	
	@RequestMapping("/updatesyorg")
	@ResponseBody
	public  Integer updateByPrimaryKey(Syorg record){
		return syorgService.updateByPrimaryKey(record);
	}
	
	@RequestMapping("/insertsyorg")
	@ResponseBody
	public  Integer insert(Syorg record){
		Integer i =syorgService.insert(record);
		return i;
	}
}
